<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>ObjectDatabase++</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/ObjectDatabase%2B%2B"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-ObjectDatabase rootpage-ObjectDatabase skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">ObjectDatabase++</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r1295905060">
/* start https://en.wikipedia.org/ */
.mw-parser-output .infobox-subbox{padding:0;border:none;margin:-3px;width:auto;min-width:100%;font-size:100%;clear:none;float:none;background-color:transparent}.mw-parser-output .infobox-3cols-child{margin:auto}.mw-parser-output .infobox .navbar{font-size:100%}@media screen{html.skin-theme-clientpref-night .mw-parser-output .infobox-full-data:not(.notheme)>div:not(.notheme)[style]{background:#1f1f23!important;color:#f8f9fa}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .infobox-full-data:not(.notheme)>div:not(.notheme)[style]{background:#1f1f23!important;color:#f8f9fa}}@media(min-width:640px){body.skin--responsive .mw-parser-output .infobox-table{display:table!important}body.skin--responsive .mw-parser-output .infobox-table>caption{display:table-caption!important}body.skin--responsive .mw-parser-output .infobox-table>tbody{display:table-row-group}body.skin--responsive .mw-parser-output .infobox-table th,body.skin--responsive .mw-parser-output .infobox-table td{padding-left:inherit;padding-right:inherit}}
/* end https://en.wikipedia.org/ */
</style><table class="infobox vevent"><tbody><tr><th colspan="2" class="infobox-above summary">ObjectDatabase++</th></tr><tr><td colspan="2" class="infobox-image logo"><span typeof="mw:File"></span></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Programmer" title="Programmer">Developer(s)</a></th><td class="infobox-data">Ekky Software</td></tr><tr style="display: none;"><td colspan="2" class="infobox-full-data"></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_release_life_cycle" title="Software release life cycle">Stable release</a></th><td class="infobox-data"><div style="margin:0px;">3.4
/ October 1, 2012<span style="display: none;"> (<span class="bday dtstart published updated itvstart">2012-10-01</span>)</span><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></div></td></tr><tr style="display:none"><td colspan="2">
</td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;">Written in</th><td class="infobox-data"><a href="C%2B%2B" title="C++">C++</a>, <a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>, <a href="VB.NET" class="mw-redirect" title="VB.NET">VB.NET</a> & <a href="TScript" title="TScript">TScript</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Operating_system" title="Operating system">Operating system</a></th><td class="infobox-data"><a href="Windows" class="mw-redirect" title="Windows">Windows</a> & <a href="Linux" title="Linux">Linux</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_categories#Categorization_approaches" title="Software categories">Type</a></th><td class="infobox-data"><a href="Object_database" title="Object database">Object database</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_license" title="Software license">License</a></th><td class="infobox-data"><a href="Proprietary_software" title="Proprietary software">Proprietary</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;">Website</th><td class="infobox-data"><span class="url"><a rel="nofollow" class="external text" href="http://www.ekkysoftware.com">www<wbr>.ekkysoftware<wbr>.com</a></span></td></tr></tbody></table>
<p><b>ObjectDatabase++</b> (<b>ODBPP</b>) is an embeddable <a href="Object_database" title="Object database">object-oriented database</a> designed for server applications that require minimal external maintenance. It is written in <a href="C%2B%2B" title="C++">C++</a> as a real-time <a href="ISAM" title="ISAM">ISAM</a> level database with the ability to auto recover from system crashes while maintaining database integrity. Its unique transaction process allows for maintenance of both the indexes and tables, preventing double allocation of index entries that could prohibit rollback of transactions.
</p><p>Features of ODBPP include: full multi-process and multi-thread transaction control, auto real-time database recovery, hierarchical object data design, native code and script access, static hash index on object IDs, numerous supported index methods including full-text and biometric pattern matching.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<ul><li>The initial development was implemented by Ekky Software from 2001 to 2003.</li>
<li>It took 4 complete rewrites of the database before testing confirmed it matched specifications and functioned as designed.</li>
<li>Over the last decade numerous product enhancements have enabled far greater index and data support.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Hierarchical_data_objects">Hierarchical data objects</h2></div>
<p>ODBPP supports objects that are hierarchical in design,<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> similar to <a href="XML" title="XML">XML</a>, <a href="JSON" title="JSON">JSON</a> or serialized <a href="PHP" title="PHP">PHP</a>. It is this hierarchical object that separates object databases from their relational cousins and it is the process of keeping the entire object in one record rather than spreading it out over multiple tables that give object databases the distinction from the relational model.
</p>
<div class="mw-heading mw-heading3"><h3 id="Traditional_relational_design">Traditional relational design</h3></div>
<p>Traditionally databases have been designed with the relational model. This would separate data over several tables and use a common identifier to relate all the child records back to their parent. These model was based on each row within the table containing individual pieces of data. SQL databases based on this design would create <a href="Join_(SQL)" title="Join (SQL)">joins</a> that would reconnect the entire relation back together, suffering performance limitations.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Object-database_design">Object-database design</h3></div>
<p>In the object database design, instead of using multiple tables to store a data object, it is stored in one a single record. This keeps the entire object intact and reducing the need to join the data back together. This process of storing the entire object in one table reduces the total amount to lock, reads and write operations required. It is also this ability to store an object in one record that reduce the amount of file reads and writes, which enables the object design to maintain efficiency with very large and very complex database designs.
</p><p>Looking at the images to the right, the on above depicts the relational model and has the data spread over two tables, with the parent in amber and the children in blue. In the object model, both the parent and children are stored in the one data record, the information that was previously stored within the related table is now stored within the sub or nested table of Foo.
</p>
<div class="mw-heading mw-heading2"><h2 id="Multi-process_transaction_control">Multi-process transaction control</h2></div>
<p>ODBPP implements a transaction control that allows for process to continue while another is terminated. This unique transaction control allows the continuing process to identify the terminated transaction, recover database integrity and continue mid transaction. It is this ability to terminate transaction at any point that enables real-time transactions implementation by server using the method.
</p><p>The transaction control utilizes four separate file to implement the entire process and flushed each change of state to the drive before continuing to the next state. This creates a time consuming process where each individual write to a file has three separate states and the entire transaction is required to pass through three separate files. Initially all adds, edit and deletes are written a shared memory file, this enables all transaction to know if a resource, such as an index value has been allocated. This memory file can be destroy when the OS starts without interfering with the database integrity, and is only used for <a href="Inter-process_communication" title="Inter-process communication">IPC</a> purposes.
</p><p>Once a transaction call the commit transaction method, the database then does the bulk of the work and writes the entire transaction from the memory file to the log file. This is done through a three stages process, first is to identify what changes are needed, then it flushed those plans to the rear of the file, once written to the drive, the header is updated to indicate the presences of the update. Secondly the file is then updated, before finally the header is modified to finalized the update. This state process ensure the consistency of the file is always valid because if the process ceases during the first stage, the file is simply truncated and the file is returned to the original state and if the transaction ceases during the second stage, the next transaction the opens the file, identifies the saved plans and re-executes those saved instructions.
</p><p>Each of the four files in updated in this manner. The transaction starts in the memory file, before been written in one update to the log file, once the transaction has the protection with the transaction secured in the log file, the ODBMS then able to update the index and table files. The entire commit process can be executed concurrently with multiple transactions committing simultaneously and is greatly benefited by using a <a href="Solid-state_drive" title="Solid-state drive">solid-state drive</a>, although the process of caching the entire transaction in the memory file and only committing to the drive at the end does help reduce the entire transaction time and is comparable to non-flushing <a href="DBMS" class="mw-redirect" title="DBMS">DBMS</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Supported_indexes">Supported indexes</h2></div>
<p>Contrary to some of the earlier object database models,<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> as an <a href="ISAM" title="ISAM">ISAM</a> level database ODBPP supports a large variety of indexes. During the initial development of the object model, the basic design was to use a schema that contained only a serialized binary object that was referred to by its ID and provided no other index access. This prevented basic search on labels and so on, and was done due to the fact that the underlining architecture was still based on the related model. Since ODBPP was always designed with the object model, it understands the hierarchical nature of the objects and is capable of indexing on data contained within.
</p>
<div class="mw-heading mw-heading3"><h3 id="Static_hash_index">Static hash index</h3></div>
<p>All objects within the database are referenced by their object identifier which is itself managed via a static <a href="Hash_table" title="Hash table">hash index</a>. A static hash index is simply an array index where the location containing the address of the object is deduced by taking the ID value, multiplying it by 12 and adding an offset value. This reveals the location of the physical address of the object. This method translating the ID into its physical address enables true order one (<i>O</i>(1)) retrieval of data, regardless of how many objects are stored within the database.
</p><p>Imposing the static has index on all table schemata allows for real-time compaction of the file, as object locks are on the index and not the object itself. This than allows for even locked objects to be moved within the file by other transactions that require more space or are deleting objects from the file. This ability to move objects within the file at any time also imposes the need to access the via the index,<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> while <a href="SQL" title="SQL">SQL</a> databases may scan through all records by scanning the file from beginning to the end, the real-time compaction prohibits this style of access.
</p>
<div class="mw-heading mw-heading3"><h3 id="B+_tree_indexes">B+ tree indexes</h3></div>
<p>The <a href="B%2B_tree" title="B+ tree">B+ tree</a> index is the primary workhorse of all databases and ODBPP is no exception. The majority of searches are carried out via seeking an index position than repetitively call for the next largest value. ODBPP supports a large number of filters on the B+ Tree to make the results more usable. For example, it can be set to convert all lower case characters to upper case, or set for the removal white spaces or non-alphanumerical characters, and also provide a <a href="Natural_sort_order" title="Natural sort order">natural sort order</a> where '9' is before '10'.
</p><p>One of the features of ODBPP over the standard DBMS is that data stored within hierarchical object can also be indexed. This will then create a situation where there are 0…<i>n</i> index values created for any one object.
</p>
<div class="mw-heading mw-heading3"><h3 id="Spatial_&_temporal_indexes">Spatial & temporal indexes</h3></div>
<p><a href="R-tree" title="R-tree">Spatial</a> indexes are used to allow searching on both two- and three-dimensional coordinates spaces. Temporal indexes are a similar idea along a one dimensional of time.
</p>
<div class="mw-heading mw-heading3"><h3 id="Biometric_pattern_matching">Biometric pattern matching</h3></div>
<p>ODBPP also supports sets of spatial data that represent key points of both two and three dimension objects such as finger print or human faces. These sets are indexed via a Spatial index which allow for group searching. The search itself will create a temporary index that has as many objects that have at least the search pattern or more points within a given error.
</p>
<div class="mw-heading mw-heading3"><h3 id="Full-text_searching">Full-text searching</h3></div>
<p>ODBPP provides full text indexing via the token list indexes. These indexes are a combination of the B+ Tree and a bucket overflow, where a text string is broken up into its individual tokens and indexed into a B+ Tree and since multiple object will have the same token value, the ID is stored in a bucket overflow (similar to dynamic <a href="Hash_table" title="Hash table">hashing</a>. With this design, full text searches are done by scanning through all tokens in the B+ Tree leaves and identifying which tokens fit the search criteria and retrieving the matching IDs.
</p><p>The full text search query also provide set logic functions to reduce the search results to a number that is usable. It allow the user to search of objects that contain token A and not token B for example.
</p>
<div class="mw-heading mw-heading2"><h2 id="Example_implementation">Example implementation</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Interface_basics">Interface basics</h3></div>
<p>ODBPP has been designed to function in both a procedural style and encapsulated object <a href="C%2B%2B" title="C++">C++</a> style. Although the object style still uses the procedural method to interface with the database at the low level, in the example the procedural method is demonstrated.
</p>
<div class="mw-heading mw-heading3"><h3 id="Native_example">Native example</h3></div>
<div class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><pre><span class="k">class</span><span class="w"> </span><span class="nc">Foo</span><span class="w"> </span><span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="w"> </span><span class="k">enum</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">TableID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">};</span>
<span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">ParentID</span><span class="p">;</span><span class="w"> </span><span class="c1">// id to link to this objects parent</span>
<span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Flags</span><span class="p">[</span><span class="mi">4</span><span class="p">];</span><span class="w"> </span><span class="c1">// 0x01 – has parent</span>
<span class="w"> </span><span class="k">enum</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">Name</span><span class="p">,</span><span class="c1">//the label given to the Foo object</span>
<span class="w"> </span><span class="n">Description</span><span class="c1">//a description of Foo</span>
<span class="w"> </span><span class="p">};</span>
<span class="p">}</span><span class="w"> </span><span class="o">*</span><span class="n">fooObject</span><span class="p">;</span>
<span class="n">CODBPP</span><span class="w"> </span><span class="n">database</span><span class="p">;</span>
<span class="n">CODBPP</span><span class="o">::</span><span class="n">Object</span><span class="w"> </span><span class="n">object</span><span class="p">;</span>
<span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="kt">char16_t</span><span class="w"> </span><span class="o">*</span><span class="n">fooName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">TEXT</span><span class="p">(</span><span class="s">"FooName"</span><span class="p">),</span><span class="w"> </span><span class="o">*</span><span class="n">message</span><span class="p">,</span><span class="w"> </span><span class="n">buffer</span><span class="p">[</span><span class="mi">128</span><span class="p">];</span>
<span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">OpenDatabase</span><span class="p">(</span><span class="n">TEXT</span><span class="p">(</span><span class="s">"C:</span><span class="se">\\</span><span class="s">Path</span><span class="se">\\</span><span class="s">To</span><span class="se">\\</span><span class="s">Database.odc"</span><span class="p">)))</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">NO_ERROR</span>
<span class="o">&&</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">BeginTransaction</span><span class="p">())</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">NO_ERROR</span>
<span class="o">&&</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">OpenTable</span><span class="p">(</span><span class="n">Foo</span><span class="o">::</span><span class="n">TableID</span><span class="p">))</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">NO_ERROR</span>
<span class="o">&&</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">ReadObject</span><span class="p">(</span><span class="n">Foo</span><span class="o">::</span><span class="n">TableID</span><span class="p">,</span><span class="w"> </span><span class="n">CODBPP</span><span class="o">::</span><span class="n">EQUALTO</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">object</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="n">fooName</span><span class="p">))</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">NO_ERROR</span><span class="p">){</span>
<span class="w"> </span><span class="n">fooObject</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">Foo</span><span class="o">*</span><span class="p">)</span><span class="n">object</span><span class="p">.</span><span class="n">fixed</span><span class="p">;</span>
<span class="w"> </span><span class="n">swprintf_s</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span><span class="w"> </span><span class="n">__countof</span><span class="p">(</span><span class="n">buffer</span><span class="p">),</span><span class="w"> </span><span class="n">TEXT</span><span class="p">(</span><span class="s">"Parent = %d, Flags = %d"</span><span class="p">),</span><span class="w"> </span><span class="n">fixedObject</span><span class="o">-></span><span class="n">ParentID</span><span class="p">,</span><span class="w"> </span><span class="n">fooObject</span><span class="o">-></span><span class="n">Flags</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
<span class="w"> </span><span class="n">MessageBox</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">GetErrorMessage</span><span class="p">(</span><span class="o">&</span><span class="n">message</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">NO_ERROR</span><span class="p">)</span>
<span class="w"> </span><span class="n">MessageBox</span><span class="p">(</span><span class="n">message</span><span class="p">);</span>
<span class="n">database</span><span class="p">.</span><span class="n">EndTransaction</span><span class="p">();</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="TScript_example">TScript example</h3></div>
<p>The equivalent <a href="TScript" title="TScript">TScript</a> example of reading an object from the database that has the name "FooName" is as follows.
</p>
<div class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><pre><span class="cp">#include</span><span class="w"> </span><span class="cpf">"ODBPP.ts"</span>
<span class="k">public</span><span class="w"> </span><span class="n">main</span><span class="p">(</span><span class="n">variable</span><span class="w"> </span><span class="n">parameters</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">null</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="n">Structure</span><span class="w"> </span><span class="n">results</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">ODBPP</span><span class="w"> </span><span class="n">database</span><span class="p">;</span>
<span class="w"> </span><span class="n">ODBPP</span><span class="p">.</span><span class="n">Object</span><span class="w"> </span><span class="n">objectHandle</span><span class="p">;</span>
<span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">OpenDatabase</span><span class="p">(</span><span class="sa">L</span><span class="s">"c:</span><span class="se">\\</span><span class="s">Path</span><span class="se">\\</span><span class="s">To</span><span class="se">\\</span><span class="s">Database.odc"</span><span class="p">);</span>
<span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">BeginTransaction</span><span class="p">();</span>
<span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">OpenTable</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">ReadIndex</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="n">CODBPP</span><span class="p">.</span><span class="n">EQUALTO</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="sa">L</span><span class="s">"FooName"</span><span class="o">:</span><span class="w"> </span><span class="n">objectHandle</span><span class="p">);</span>
<span class="w"> </span><span class="n">database</span><span class="p">.</span><span class="n">FragmentObject</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="n">objectHandle</span><span class="o">:</span><span class="n">results</span><span class="p">);</span>
<span class="w"> </span><span class="n">System</span><span class="o">::</span><span class="n">MessageBox</span><span class="p">(</span><span class="sa">L</span><span class="s">"Parent = "</span><span class="o">+</span><span class="n">results</span><span class="p">.</span><span class="n">ParentID</span><span class="o">+</span><span class="sa">L</span><span class="s">", Flags = "</span><span class="o">+</span><span class="n">results</span><span class="p">.</span><span class="n">Flags</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="C#_example">C# example</h3></div>
<p>ObjectDatabase++ is also exposed via <a href="Component_Object_Model" title="Component Object Model">COM</a> wrapper class 'ODBPPLib.ODBPP'. The equivalent C# example of reading an object from the database that has the name "FooName" is as follows.
</p>
<div class="mw-highlight mw-highlight-lang-csharp mw-content-ltr" dir="ltr"><pre><span class="k">private</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">button1_Click</span><span class="p">(</span><span class="kt">object</span><span class="w"> </span><span class="n">sender</span><span class="p">,</span><span class="w"> </span><span class="n">EventArgs</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">ODBPPLib</span><span class="p">.</span><span class="n">ODBPP</span><span class="w"> </span><span class="n">odbpp</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">ODBPPLib</span><span class="p">.</span><span class="n">ODBPP</span><span class="p">();</span>
<span class="w"> </span><span class="n">odbpp</span><span class="p">.</span><span class="n">OpenDatabase</span><span class="p">(</span><span class="s">@"C:\Path\To\Database.odc"</span><span class="p">);</span>
<span class="w"> </span><span class="n">odbpp</span><span class="p">.</span><span class="n">BeginTransaction</span><span class="p">(</span><span class="n">odbpp</span><span class="p">.</span><span class="n">SHARED</span><span class="p">,</span><span class="w"> </span><span class="m">6000</span><span class="p">);</span>
<span class="w"> </span><span class="n">odbpp</span><span class="p">.</span><span class="n">OpenTable</span><span class="p">(</span><span class="m">1</span><span class="p">);</span>
<span class="w"> </span><span class="n">ODBPPLib</span><span class="p">.</span><span class="n">DatabaseObject</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">odbpp</span><span class="p">.</span><span class="n">ReadObject</span><span class="p">(</span><span class="m">1</span><span class="p">,</span><span class="w"> </span><span class="n">odbpp</span><span class="p">.</span><span class="n">EQUALTO</span><span class="p">,</span><span class="w"> </span><span class="m">1</span><span class="p">,</span><span class="w"> </span><span class="s">"FooName"</span><span class="p">);</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">results</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">null</span><span class="p">)</span>
<span class="w"> </span><span class="n">MessageBox</span><span class="p">.</span><span class="n">Show</span><span class="p">(</span><span class="s">"Parent = "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">results</span><span class="p">.</span><span class="n">readField</span><span class="p">(</span><span class="s">"ParentID"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s">", Flags = "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">results</span><span class="p">.</span><span class="n">readField</span><span class="p">(</span><span class="s">"Flags"</span><span class="p">));</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">MessageBox</span><span class="p">.</span><span class="n">Show</span><span class="p">(</span><span class="n">e1</span><span class="p">.</span><span class="n">Message</span><span class="p">);</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.ekkysoftware.com/Downloads">Ekky Software</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20120929044431/http://www.ekkysoftware.com/Downloads">Archived</a> 2012-09-29 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20130821182036/http://www.ekkysoftware.com/Sales">"Ekky Software Sales"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.ekkysoftware.com/Sales">the original</a> on 2013-08-21<span class="reference-accessdate">. Retrieved <span class="nowrap">2013-08-02</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text">Khoualdi, K, & Alghamdi, T 2011, 'Developing Systems by Using Object Oriented Database Practical Study on ISO 9001:2000 System', Journal of Software Engineering & Applications, 4, 12, pp. 666–671, Computers & Applied Sciences Complete</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text">Naser, T, Alhajj, R, & Ridley, M 2009, 'Two-Way Mapping between Object-Oriented Databases and XML', Informatica (03505596), 33, 3, pp. 297–308, Computers & Applied Sciences Complete</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text">Suri, P, & Sharma, M 2011, 'A COMPARATIVE STUDY BETWEEN THE PERFORMANCE OF RELATIONAL & OBJECT ORIENTED DATABASE IN DATA WAREHOUSING', International Journal of Database Management Systems, 3, 2, pp. 116–127, Computers & Applied Sciences Complete</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text">Hardwick, M, Samaras, G, 1989, 'Using a relational database as an index to a distributed object database in engineering design systems ', Data and Knowledge Systems for Manufacturing and Engineering, 1989., Second International Conference on
Date of Conference: 16-18 Oct 1989</span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text">Zhang, F, Ma, Z, & Yan, L 2011, 'Construction of ontologies from object-oriented database models', Integrated Computer-Aided Engineering, 18, 4, pp. 327–347, Computers & Applied Sciences Complete</span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text">Lee, K.C.K; Hong Va Leong; Si, A. 2003, 'Approximating object location for moving object database', Distributed Computing Systems Workshops, 2003. Proceedings. 23rd International Conference on
Date of Conference: 19–22 May 2003.</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20120926131201/http://www.ekkysoftware.com/ODBPP">Introduction to ObjectDatabase++</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-01-18" href="https://en.wikipedia.org/wiki/?title=ObjectDatabase%2B%2B&oldid=1270139465">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>